'''
@Company: TWL
@Author: xue jian
@Email: xuejian@kanzhun.com
@Date: 2020-01-16 18:07:40
'''
import os
import sys
import json
sys.path.append(os.path.abspath(os.path.join(os.path.dirname('__file__'), os.path.pardir)))

import thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from hulk_proxy.HulkProxyServ import Client
from scan_data.ttypes import ScanData

__HOST = "172.21.32.54"
__PORT = 10088

# try:
tsocket = TSocket.TSocket(__HOST, __PORT)
transport = TTransport.TFramedTransport(tsocket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = Client(protocol)

transport.open()

# f = open('/data1/arc_six/wuxiushan/xgboost_test/gbdt.bin', 'rb')
# line = f.read()
# line = str(line)
# # print(line)
# line = line.replace("b'", '')
# print(line[:20])
# client.hpush('test_model1', 'model', line)
# f.close()

# client.hget('test_model', 'model')


transport.close()
# except thrift.TException as ex:
#     print(ex.message)